home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / disk / misc / string11.lha / freeclop.c < prev    next >
C/C++ Source or Header  |  1990-12-30  |  635b  |  36 lines

  1. /*
  2.  *  FILE
  3.  *    freeclop.c
  4.  *
  5.  *  DESCRIPTION
  6.  *    This function will release all memory allocated by the
  7.  *    clop() function.
  8.  *
  9.  *  AUTHOR
  10.  *    Anders 'ALi' Lindgren
  11.  *    Mälarblick 8
  12.  *    S-161 51 Bromma
  13.  *    Sweden
  14.  */
  15.  
  16. #include "stdlib.h"
  17.  
  18. #include "clop.h"
  19.  
  20. void __stdargs
  21. freeclop(struct clop_array * clop_array)
  22. {
  23.     register int i;
  24.  
  25.     for (i=0; clop_array[i].type != CLOPT_END; i++) {
  26.     if (clop_array[i].type == CLOPT_STRING) {
  27.         if(clop_array[i].outflags & CLOPOF_ALLOCATED) {
  28.         free(clop_array[i].value.string);
  29.         clop_array[i].outflags &= ~CLOPOF_ALLOCATED;
  30.         }
  31.         clop_array[i].value.string = NULL;
  32.     } 
  33.     }
  34.     return;
  35. }
  36.